package com.borko.healthcare.persistence.hibernate.services;

import java.util.List;

import com.borko.healthcare.entities.interfaces.UserDetails;
import com.borko.healthcare.persistence.hibernate.dao.UserDetailsDAO;

public class UserDetailsManagerImpl implements UserDetailsManager {
	
	private UserDetailsDAO userDetailsDAO;

	public UserDetailsDAO getSupplierDAO() {
		return this.userDetailsDAO;
	}

	public void setUserDetailsDAO(UserDetailsDAO userDetailsDAO) {
		this.userDetailsDAO = userDetailsDAO;
	}

	public void add(UserDetails userDetails) {
		userDetailsDAO.create(userDetails);
	}

	public void applyChanges(UserDetails userDetails) {
		userDetailsDAO.update(userDetails);
	}

	public List<UserDetails> list() {
		return userDetailsDAO.retrive();
	}

	public void remove(UserDetails userDetails) {
		userDetailsDAO.delete(userDetails);
	}

	public UserDetails getUserDetails(int id) {
		return userDetailsDAO.getUserDetails(id);
	}
}
